@import '/variable.less';

.home-container {
  min-height: 100vh;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  padding-bottom: 100px;
}

/* 顶部导航栏 */
.top-navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);

  .nav-title {
    font-size: 18px;
    font-weight: bold;
    color: #333333;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  .nav-publish-btn {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;

    &:active {
      transform: scale(0.9);
    }
    
    &:hover {
      box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
    }
  }
}

/* 每日一句猜书名游戏区 */
.daily-quote-section {
  margin: 20px 20px 24px;

  .quote-card {
    background: linear-gradient(135deg, #FFFDE7 0%, #FFF8DC 100%);
    padding: 24px;
    border-radius: 16px;
    position: relative;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 193, 71, 0.1);

    &:hover {
      transform: translateY(-2px);
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    }

    .quote-content {
      font-size: 16px;
      line-height: 1.6;
      color: #333333;
      text-align: center;
      margin-bottom: 16px;
      font-family: 'PingFang SC', 'Hiragino Sans GB', sans-serif;

      &.clickable {
        cursor: pointer;
        position: relative;
        transition: all 0.2s ease;

        &:active {
          transform: scale(0.98);
          opacity: 0.8;
        }
      }
    }

    .quote-hint {
      font-size: 13px;
      color: #999999;
      text-align: center;
      font-style: italic;
    }

    .quiz-result {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 8px;
      margin-bottom: 16px;

      .result-icon {
        &.correct {
          animation: bounce 0.6s ease;
        }

        &.incorrect {
          animation: shake 0.6s ease;
        }

        .result-emoji {
          font-size: 24px;
          display: block;
        }
      }

      .result-text {
        font-size: 14px;
        color: #333333;
        text-align: center;
      }
    }

    .quote-full-info {
      margin-top: 16px;
      padding-top: 16px;
      border-top: 1px solid rgba(0, 0, 0, 0.1);

      .book-info {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 4px;
        margin-bottom: 8px;

        .book-title {
          font-size: 16px;
          font-weight: bold;
          color: #333333;
        }

        .book-author {
          font-size: 14px;
          color: #888888;
        }
      }

      .submit-info {
        font-size: 12px;
        color: #CCCCCC;
        text-align: center;
      }
    }

    .expand-btn {
      background: #FFB347;
      color: #FFFFFF;
      border: none;
      border-radius: 8px;
      padding: 8px 16px;
      font-size: 12px;
      margin: 0 auto;
      display: block;
      transition: all 0.3s ease;

      &:active {
        transform: scale(0.95);
      }
    }

    .quote-full-info {
      margin-top: 16px;
      padding-top: 16px;
      border-top: 1px solid rgba(0, 0, 0, 0.1);

      .book-info {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 4px;
        margin-bottom: 8px;

        .book-title {
          font-size: 16px;
          font-weight: bold;
          color: #333333;
        }

        .book-author {
          font-size: 14px;
          color: #888888;
        }
      }

      .submit-info {
        font-size: 12px;
        color: #CCCCCC;
        text-align: center;
      }
    }


  }
}



.full-content-popup {
  .popup-content {
    background: #FFFDE7;
    border-radius: 12px;
    padding: 24px;
    margin: 20px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;

    .popup-close {
      position: absolute;
      top: 12px;
      right: 12px;
      width: 32px;
      height: 32px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 50%;
      background: rgba(255, 255, 255, 0.8);
      transition: all 0.3s ease;

      &:active {
        transform: scale(0.9);
      }
    }

    .popup-text {
      font-size: 16px;
      line-height: 1.6;
      color: #333333;
      text-align: center;
      margin-bottom: 24px;
      font-family: 'PingFang SC', 'Hiragino Sans GB', sans-serif;
    }

    .popup-book-info {
      text-align: center;

      .popup-book-title {
        font-size: 16px;
        font-weight: bold;
        color: #333333;
        display: block;
        margin-bottom: 8px;
      }

      .popup-submit-info {
        font-size: 12px;
        color: #CCCCCC;
      }
    }
  }
}

.title-upgrade-popup {
  .upgrade-content {
    background: #FFFFFF;
    border-radius: 16px;
    padding: 32px 24px;
    margin: 20px;
    text-align: center;

    .upgrade-icon {
      margin-bottom: 16px;
      animation: starShine 1s ease-in-out;
    }

    .upgrade-title {
      font-size: 18px;
      font-weight: bold;
      color: #333333;
      margin-bottom: 12px;
    }

    .upgrade-new-title {
      font-size: 24px;
      font-weight: bold;
      color: #FFB347;
      margin-bottom: 16px;
      animation: titleGlow 2s ease-in-out infinite;
    }

    .upgrade-desc {
      font-size: 14px;
      color: #666666;
      margin-bottom: 24px;
    }

    .upgrade-confirm-btn {
      background: #FFB347;
      color: #FFFFFF;
      border: none;
      border-radius: 8px;
      padding: 12px 32px;
      font-size: 14px;
      font-weight: 500;
      transition: all 0.3s ease;

      &:active {
        transform: scale(0.95);
      }
    }
  }
}

/* 动画效果 */
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-5px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(5px);
  }
}

@keyframes starShine {
  0% {
    transform: scale(0) rotate(0deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.2) rotate(180deg);
    opacity: 1;
  }
  100% {
    transform: scale(1) rotate(360deg);
    opacity: 1;
  }
}

@keyframes titleGlow {
  0%, 100% {
    text-shadow: 0 0 5px rgba(255, 179, 71, 0.5);
  }
  50% {
    text-shadow: 0 0 20px rgba(255, 179, 71, 0.8);
  }
}

/* 发布入口按钮 */
.publish-entry {
  margin: 0 20px 20px;
  display: flex;
  justify-content: center;

  .publish-btn {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.25);
    transition: all 0.3s ease;
    border: none;
    position: relative;
    overflow: hidden;

    &::before {
      content: '';
      position: absolute;
      top: 0;
      left: -100%;
      width: 100%;
      height: 100%;
      background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
      transition: left 0.5s ease;
    }

    &:active {
      transform: scale(0.98);
      box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
    }

    &:hover::before {
      left: 100%;
    }

    .publish-text {
      color: #FFFFFF;
      font-size: 16px;
      font-weight: 600;
      letter-spacing: 0.5px;
    }
  }
}





/* 我的历史分享列表 */
.posts-section {
  margin: 0 20px 24px;

  .section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 0 4px;

    .section-title {
      font-size: 18px;
      font-weight: 600;
      color: #333333;
      background: linear-gradient(45deg, #667eea, #764ba2);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
    }

    .section-count {
      font-size: 14px;
      color: #888888;
      background: rgba(102, 126, 234, 0.1);
      padding: 4px 8px;
      border-radius: 12px;
      font-weight: 500;
    }
  }

  .posts-list {
    .quote-card {
      background: #FFFFFF;
      border-radius: 16px;
      padding: 20px;
      margin-bottom: 16px;
      display: flex;
      gap: 16px;
      box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
      transition: all 0.3s ease;
      border: 1px solid rgba(0, 0, 0, 0.02);

      &:active {
        transform: scale(0.98);
      }

      &:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
      }

      .book-cover-section {
        flex-shrink: 0;
        display: flex;
        flex-direction: column;
        gap: 8px;

        .book-cover {
          width: 64px;
          height: 84px;
          border-radius: 8px;
          box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
          transition: all 0.3s ease;

          &:hover {
            transform: scale(1.05);
            box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
          }
        }

        .book-info {
          display: flex;
          flex-direction: column;
          gap: 2px;

          .book-title {
            font-size: 11px;
            font-weight: 600;
            color: #333333;
            line-height: 1.3;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
            text-align: center;
          }

          .book-author {
            font-size: 9px;
            color: #888888;
            line-height: 1.2;
            display: -webkit-box;
            -webkit-line-clamp: 1;
            -webkit-box-orient: vertical;
            overflow: hidden;
            text-align: center;
            font-style: italic;
          }
        }
      }

      .quote-content-section {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: space-between;

        .quote-content {
          margin-bottom: 12px;

          .quote-text {
            font-size: 14px;
            color: #333333;
            line-height: 1.5;
            display: -webkit-box;
            -webkit-line-clamp: 3;
            -webkit-box-orient: vertical;
            overflow: hidden;
            transition: all 0.3s ease;

            &.expanded {
              -webkit-line-clamp: unset;
            }

            &:active {
              opacity: 0.7;
            }
          }


        }

        .thoughts-section {
          margin-bottom: 12px;

          .thoughts-preview {
            .thoughts-text {
              font-size: 12px;
              color: #888888;
              line-height: 1.4;
              display: -webkit-box;
              -webkit-line-clamp: 2;
              -webkit-box-orient: vertical;
              overflow: hidden;
              transition: all 0.3s ease;

              &.expanded {
                -webkit-line-clamp: unset;
              }

              &:active {
                opacity: 0.7;
              }
            }


          }
        }

        .quote-time {
          font-size: 12px;
          color: #999999;
          margin-bottom: 12px;
        }

        .quote-actions {
          display: flex;
          gap: 16px;

          .action-btn {
            display: flex;
            align-items: center;
            gap: 4px;
            padding: 4px 8px;
            border-radius: 6px;

            .action-count {
              font-size: 12px;
              color: #888888;
            }
          }
        }
      }
    }

    .post-card {
      background: #FFFFFF;
      border-radius: 16px;
      padding: 20px;
      margin-bottom: 16px;
      display: flex;
      gap: 16px;
      box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
      transition: all 0.3s ease;
      border: 1px solid rgba(0, 0, 0, 0.02);

      &:active {
        transform: scale(0.98);
      }

      &:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
      }

      .book-cover-section {
        flex-shrink: 0;
        display: flex;
        flex-direction: column;
        gap: 8px;

        .book-cover {
          width: 64px;
          height: 84px;
          border-radius: 8px;
          box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
          transition: all 0.3s ease;

          &:hover {
            transform: scale(1.05);
            box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
          }
        }

        .book-info {
          display: flex;
          flex-direction: column;
          gap: 2px;

          .book-title {
            font-size: 12px;
            font-weight: 600;
            color: #333333;
            line-height: 1.3;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
          }

          .book-author {
            font-size: 10px;
            color: #888888;
            line-height: 1.2;
            display: -webkit-box;
            -webkit-line-clamp: 1;
            -webkit-box-orient: vertical;
            overflow: hidden;
          }
        }
      }

      .post-content-section {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: space-between;

        .book-title {
          font-size: 16px;
          font-weight: 600;
          color: #333333;
          margin-bottom: 8px;
          line-height: 1.4;
        }

        .post-preview {
          font-size: 14px;
          color: #666666;
          line-height: 1.5;
          margin-bottom: 8px;
          display: -webkit-box;
          -webkit-line-clamp: 2;
          -webkit-box-orient: vertical;
          overflow: hidden;
        }

        .post-time {
          font-size: 12px;
          color: #888888;
          margin-bottom: 12px;
        }

        .post-actions {
          display: flex;
          gap: 16px;

          .action-btn {
            display: flex;
            align-items: center;
            gap: 4px;
            padding: 4px 8px;
            border-radius: 6px;
            transition: all 0.3s ease;

            &:active {
              background: rgba(0, 0, 0, 0.05);
            }

            .action-count {
              font-size: 12px;
              color: #888888;
            }
          }
        }
      }
    }
  }
}

/* 空状态 */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;

  .empty-icon-placeholder {
    width: 120px;
    height: 120px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  }

  .empty-text {
    font-size: 16px;
    color: #666666;
    margin-bottom: 20px;
    font-weight: 500;
  }

  .empty-action {
    font-size: 14px;
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    padding: 12px 20px;
    border-radius: 24px;
    border: 1px solid rgba(102, 126, 234, 0.2);
    transition: all 0.3s ease;
    font-weight: 500;

    &:active {
      background: #667eea;
      color: #FFFFFF;
      transform: scale(0.95);
    }
  }
}

/* 加载状态 */
.loading-state {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 60px 0;
}

/* 没有更多 */
.no-more {
  text-align: center;
  padding: 30px 0;
  font-size: 14px;
  color: #999999;
  font-style: italic;
}



/* 猜书名弹窗样式 */
.quote-popup {
  width: 320px;
  background: #FFFFFF;
  border-radius: 16px;
  overflow: hidden;

  .popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #F0F0F0;

    .popup-title {
      font-size: 18px;
      font-weight: 600;
      color: #333333;
    }

    .popup-close {
      width: 32px;
      height: 32px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 50%;
      background: #F5F5F5;
      transition: all 0.3s ease;

      &:active {
        background: #E0E0E0;
      }
    }
  }

  .popup-content {
    padding: 24px;

    .quote-full-text {
      font-size: 16px;
      line-height: 1.6;
      color: #333333;
      margin-bottom: 24px;
      text-align: center;
      font-family: 'PingFang SC', 'Hiragino Sans GB', sans-serif;
    }

    .input-section {
      margin-bottom: 24px;

      .input-label {
        font-size: 14px;
        color: #666666;
        margin-bottom: 8px;
      }

      .answer-input {
        width: 100%;
      }
    }

    .popup-actions {
      display: flex;
      gap: 12px;

      .cancel-btn {
        flex: 1;
      }

      .submit-btn {
        flex: 1;
        background: #FFB347;
        border-color: #FFB347;

        &:active {
          background: #FFA726;
          border-color: #FFA726;
        }
      }
    }
  }
}
